//
//  BaseButton.m
//  liBaQiang
//
//  Created by 奇林刘 on 2018/10/9.
//  Copyright © 2018年 liu. All rights reserved.
//

#import "BaseButton.h"

@interface BaseButton ()


@end

@implementation BaseButton

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self makeBackgroundImageView];
        [self configSelf];
        [self allocateComponents];
        [self layoutComponents];
        [self configComponents];
    }
    return self;
}

- (void)configSelf {
    
}

- (void)allocateComponents {
    
}

- (void)layoutComponents {
    
}

- (void)configComponents {
    
}

- (void)makeBackgroundImageView {
    self.fp_addSubview(self.backgroundImageView=[[UIImageView alloc]init].fp_contentMode(UIViewContentModeScaleToFill));
    [self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(self);
    }];
}

- (void)setBackgroundImageWithImageName:(NSString *)name {
    [self.backgroundImageView setImage:[UIImage imageNamed:name]];
}


@end
